package com.ftg.midamall.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author qjw
 * @version 1.0
 * @date 2023/10/16 下午1:31
 */
@RestController
public class ProductDemo {

    //template

    //restful api 标准 get post put delete

    @GetMapping("/pms/demo")
    public String cllUmsDemo(){
        //pms/demo --http 网间调用-- /uml/demo
        String ums = restTemplate.getForObject("http://localhost:7000/demo",String.class);
        return "这是我调用 其它ip下面的 ums里面的 /demo方法返回的信息 ==> "+ ums;
    }

    @Autowired
    RestTemplate restTemplate;



}